import{d as C,B as S,a as o,o as r,b as c,w as e,q as m,e as a,m as V,f as i,E as b,W as g,t as p,F as B,c as R,U as E,K as L,n as f,a3 as N,p as A,_ as D}from"./index-c80Lh_is.js";import{A as I}from"./AppCollection-jlsv_00S.js";import{L as K}from"./LinkBox-dXHA5onU.js";const T=C({__name:"ExternalServiceListView",setup($){const _=S();return(q,F)=>{const k=o("RouteTitle"),d=o("RouterLink"),y=o("KCard"),h=o("AppView"),v=o("DataSource"),w=o("RouteView");return r(),c(v,{src:"/me"},{default:e(({data:x})=>[x?(r(),c(w,{key:0,name:"external-service-list-view",params:{page:1,size:x.pageSize,mesh:""}},{default:e(({can:z,route:s,t:n})=>[a(v,{src:`/meshes/${s.params.mesh}/external-services?page=${s.params.page}&size=${s.params.size}`},{default:e(({data:l,error:u})=>[a(h,null,N({title:e(()=>[V("h2",null,[a(k,{title:n(`${m(_).name==="service-list-view"?"":"external-"}services.routes.items.title`)},null,8,["title"])])]),default:e(()=>[i(),i(),a(y,null,{default:e(()=>[u!==void 0?(r(),c(b,{key:0,error:u},null,8,["error"])):(r(),c(I,{key:1,class:"external-service-collection","data-testid":"external-service-collection","empty-state-message":n("common.emptyState.message",{type:"External Services"}),"empty-state-cta-to":n("external-services.href.docs"),"empty-state-cta-text":n("common.documentation"),headers:[{label:"Name",key:"name"},{label:"Address",key:"address"},{label:"Details",key:"details",hideLabel:!0}],"page-number":s.params.page,"page-size":s.params.size,total:l==null?void 0:l.total,items:l==null?void 0:l.items,error:u,onChange:s.update},{name:e(({row:t})=>[a(g,{text:t.name},{default:e(()=>[a(d,{to:{name:"external-service-detail-view",params:{mesh:t.mesh,service:t.name},query:{page:s.params.page,size:s.params.size}}},{default:e(()=>[i(p(t.name),1)]),_:2},1032,["to"])]),_:2},1032,["text"])]),address:e(({row:t})=>[t.networking.address?(r(),c(g,{key:0,text:t.networking.address},null,8,["text"])):(r(),R(B,{key:1},[i(p(n("common.collection.none")),1)],64))]),details:e(({row:t})=>[a(d,{class:"details-link","data-testid":"details-link",to:{name:"external-service-detail-view",params:{mesh:t.mesh,service:t.name}}},{default:e(()=>[i(p(n("common.collection.details_link"))+" ",1),a(m(E),{display:"inline-block",decorative:"",size:m(L)},null,8,["size"])]),_:2},1032,["to"])]),_:2},1032,["empty-state-message","empty-state-cta-to","empty-state-cta-text","page-number","page-size","total","items","error","onChange"]))]),_:2},1024)]),_:2},[z("use gateways ui")?{name:"actions",fn:e(()=>[a(K,null,{default:e(()=>[a(d,{class:f({active:m(_).name==="service-list-view"}),to:{name:"service-list-view",params:{mesh:s.params.mesh}}},{default:e(()=>[i(p(n("services.routes.items.navigation.internal")),1)]),_:2},1032,["class","to"]),i(),a(d,{class:f({active:m(_).name==="external-service-list-view"}),to:{name:"external-service-list-view",params:{mesh:s.params.mesh}}},{default:e(()=>[i(p(n("services.routes.items.navigation.external")),1)]),_:2},1032,["class","to"])]),_:2},1024)]),key:"0"}:void 0]),1024)]),_:2},1032,["src"])]),_:2},1032,["params"])):A("",!0)]),_:1})}}}),Z=D(T,[["__scopeId","data-v-13945d03"]]);export{Z as default};
